home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / Xmfbpmax / machine / dc7085cons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  8.6 KB  |  290 lines

  1.  
  2. /*
  3.  * @(#)dc7085cons.h    4.7    (ULTRIX)    12/16/88
  4.  */
  5.  
  6. /************************************************************************
  7.  *                                    *
  8.  *            Copyright (c) 1988 by                *
  9.  *        Digital Equipment Corporation, Maynard, MA        *
  10.  *            All rights reserved.                *
  11.  *                                    *
  12.  *   This software is furnished under a license and may be used and    *
  13.  *   copied  only  in accordance with the terms of such license and    *
  14.  *   with the  inclusion  of  the  above  copyright  notice.   This    *
  15.  *   software  or  any    other copies thereof may not be provided or    *
  16.  *   otherwise made available to any other person.  No title to and    *
  17.  *   ownership of the software is hereby transferred.            *
  18.  *                                    *
  19.  *   The information in this software is subject to change  without    *
  20.  *   notice  and should not be construed as a commitment by Digital    *
  21.  *   Equipment Corporation.                        *
  22.  *                                    *
  23.  *   Digital assumes no responsibility for the use  or    reliability    *
  24.  *   of its software on equipment which is not supplied by Digital.    *
  25.  *                                    *
  26.  ************************************************************************
  27.  *
  28.  * dc7085cons.h
  29.  *
  30.  * DC7085 SLU console driver
  31.  *
  32.  * Modification history
  33.  *
  34.  * 16-Dec-1988 - Randall P. Brown
  35.  *    Added the struct for pdma, and included the pdma struct in the
  36.  *     cn_softc struct.
  37.  *
  38.  * 17-Nov-1988 - Randall P. Brown
  39.  *    Cleaned up file so that names are consistent with spec.
  40.  *
  41.  *  7-Jul-1988 - rsp (Ricky Palmer)
  42.  *    Created file. Contents based on ssreg.h file.
  43.  *
  44.  */
  45.  
  46. /* Serial line registers */
  47. struct cn_reg {
  48.     u_short DZ_CSR;            /* SLU control status register    */
  49.     u_short pad1[3];
  50.     union {                /* SLU read buffer/line param.    */
  51.         u_short DZ_RBUF;
  52.         u_short DZ_LPR;
  53.     } DZ_RBUF_LPR;
  54.     u_short pad2[3];
  55.     u_short DZ_TCR;            /* SLU transmitter control reg. */
  56.     u_short pad3[3];
  57.     union {                /* SLU modem status/txmt reg.    */
  58.         u_short    DZ_MSR;
  59.         u_short DZ_TDR;
  60.     } DZ_MSR_TDR;
  61. };
  62.  
  63. #define cncsr        sc_regs->DZ_CSR
  64. #define cndtr        sc_regs->DZ_TCR
  65. #define cnmsr        sc_regs->DZ_MSR_TDR.DZ_MSR
  66. #define cnbrk        sc_regs->DZ_MSR_TDR.DZ_MSR
  67. #define cnrbuf        sc_regs->DZ_RBUF_LPR.DZ_RBUF
  68. #define cnlpr        sc_regs->DZ_RBUF_LPR.DZ_LPR
  69. #define cntcr        sc_regs->DZ_TCR
  70. #define cntbuf        sc_regs->DZ_MSR_TDR.DZ_TDR
  71.  
  72. #define CONSOLEMAJOR    0
  73. #define CNMAJOR 0
  74. #define NCNLINE 5 /* 4 real lines + silly XCONSDEV */
  75. #define XCONSDEV 4
  76.  
  77. /* Interrupt controller register bits */
  78. #define SINT_SR 0200            /* Serial line recv/silo full    */
  79. #define SINT_ST 0100            /* Serial line transmitter done */
  80.  
  81. /* Control status register definitions (cncsr) */
  82. #define CN_OFF        0x00        /* Modem control off        */
  83. #define CN_MAINT    0x08        /* Maintenance            */
  84. #define CN_CLR        0x10        /* Reset dc7085 chip        */
  85. #define CN_MSE        0x20        /* Master Scan Enable        */
  86. #define CN_RIE        0x40        /* Receive IE */
  87. #define CN_RDONE    0x80        /* Receiver done        */
  88. #define CN_TIE        0x4000        /* Trasmit IE */
  89. #define CN_TRDY        0x8000        /* Transmit ready        */
  90.  
  91. /* Line parameter register definitions (cnlpr) */
  92. #define BITS5        0x00        /* 5 bit char width        */
  93. #define BITS6        0x08        /* 6 bit char width        */
  94. #define BITS7        0x10        /* 7 bit char width        */
  95. #define BITS8        0x18        /* 8 bit char width        */
  96. #define TWOSB        0x20        /* two stop bits        */
  97. #define PENABLE        0x40        /* parity enable        */
  98. #define OPAR        0x80        /* odd parity            */
  99. #define CN_B4800    0xc00        /* 4800 BPS speed        */
  100. #define CN_B9600    0xe00        /* 9600 BPS speed        */
  101. #define CN_RE        0x1000        /* Receive enable        */
  102.  
  103. /* Receiver buffer register definitions (cnrbuf) */
  104. #define CN_PE        0x1000        /* Parity error            */
  105. #define CN_FE        0x2000        /* Framing error        */
  106. #define CN_DO        0x4000        /* Data overrun error        */
  107. #define CN_DVAL        0x8000        /* Receive buffer data valid    */
  108.  
  109. /* Line control status definitions (cnlcs) */
  110. #define CN_SR        0x08        /* Secondary Receive        */
  111. #define CN_CTS        0x10        /* Clear To Send        */
  112. #define CN_CD        0x20        /* Carrier Detect        */
  113. #define CN_RI        0x40        /* Ring Indicate        */
  114. #define CN_DSR        0x80        /* Data Set Ready        */
  115. #define CN_LE        0x100        /* Line Enable            */
  116. #define CN_DTR        0x200        /* Data Terminal Ready        */
  117. #define CN_BRK        0x400        /* Break            */
  118. #define CN_ST        0x800        /* Secondary Transmit        */
  119. #define CN_RTS        0x1000        /* Request To Send        */
  120.  
  121. /* DM lsr definitions */
  122. #define SML_LE        0x01        /* Line enable            */
  123. #define SML_DTR        0x02        /* Data terminal ready        */
  124. #define SML_RTS        0x04        /* Request to send        */
  125. #define SML_ST        0x08        /* Secondary transmit        */
  126. #define SML_SR        0x10        /* Secondary receive        */
  127. #define SML_CTS        0x20        /* Clear to send        */
  128. #define SML_CAR        0x40        /* Carrier detect        */
  129. #define SML_RNG        0x80        /* Ring                */
  130. #define SML_DSR        0x100        /* Data set ready, not DM bit    */
  131.  
  132. /* cndtr bits */
  133. #define CN_RDTR 0x400            /* REAL data terminal ready    */
  134.  
  135. /* cnmsr bits */
  136. #define CN_RDSR 0x200            /* REAL data set ready bit    */
  137. #define CN_XMIT CN_RDSR            /* Ready to transmit & rec.    */
  138.  
  139. /* Monochrome definitions */
  140. #define SELF_TEST    'T'
  141. #define INCREMENTAL    'R'
  142. #define PROMPT        'D'
  143.  
  144. #define MOUSE_ID    0x2
  145. #define TABLET_ID    0x4
  146.  
  147. #define START_FRAME    0x80        /* start of report frame bit    */
  148. #define X_SIGN        0x10        /* sign bit for X        */
  149. #define Y_SIGN        0x08        /* sign bit for Y        */
  150.  
  151. #define UPDATE_POS    0x01
  152.  
  153. /* Interrupt controller register bits */
  154. #define SINT_VF        010
  155.  
  156. /* Cursor Command Register bits */
  157. #define ENPA    0000001
  158. #define FOPA    0000002
  159. #define ENPB    0000004
  160. #define FOPB    0000010
  161. #define XHAIR    0000020
  162. #define XHCLP    0000040
  163. #define XHCL1    0000100
  164. #define XHWID    0000200
  165. #define ENRG1    0000400
  166. #define FORG1    0001000
  167. #define ENRG2    0002000
  168. #define FORG2    0004000
  169. #define LODSA    0010000
  170. #define VBHI    0020000
  171. #define HSHI    0040000
  172. #define TEST    0100000
  173.  
  174.  
  175. /* Line Prameter Register bits */
  176. #define SER_KBD      000000
  177. #define SER_POINTER  000001
  178. #define SER_COMLINE  000002
  179. #define SER_PRINTER  000003
  180. #define SER_CHARW    000030
  181. #define SER_STOP     000040
  182. #define SER_PARENB   000100
  183. #define SER_ODDPAR   000200
  184. #define SER_SPEED    006000
  185. #define SER_RXENAB   010000
  186.  
  187. /* Definitions for mouse buttons */
  188. #define EVENT_LEFT_BUTTON    0x01
  189. #define EVENT_MIDDLE_BUTTON    0x02
  190. #define EVENT_RIGHT_BUTTON    0x03
  191. #define RIGHT_BUTTON        0x01
  192. #define MIDDLE_BUTTON        0x02
  193. #define LEFT_BUTTON        0x04
  194.  
  195. /* Mouse definitions */
  196. #define MOTION_BUFFER_SIZE 100
  197. #define SELF_TEST    'T'
  198.  
  199. /* Mouse report structure definition */
  200. struct mouse_report {
  201.     char state;            /* buttons and sign bits    */
  202.     short dx;            /* delta X since last change    */
  203.     short dy;            /* delta Y since last change    */
  204.     char bytcnt;            /* mouse report byte count    */
  205. };
  206.  
  207.  
  208. /* Definitions for tablet buttons */
  209. #define EVENT_T_LEFT_BUTTON    0x00
  210. #define EVENT_T_FRONT_BUTTON    0x01
  211. #define EVENT_T_RIGHT_BUTTON    0x02
  212. #define EVENT_T_BACK_BUTTON    0x04
  213. #define T_LEFT_BUTTON        0x02
  214. #define T_FRONT_BUTTON        0x04
  215. #define T_RIGHT_BUTTON        0x08
  216. #define T_BACK_BUTTON        0x10
  217.  
  218. /* Lk201/301 keyboard */
  219. #define LK_UPDOWN    0x86        /* bits for setting lk201 modes */
  220. #define LK_AUTODOWN    0x82
  221. #define LK_DOWN        0x80
  222. #define LK_DEFAULTS    0xd3        /* reset (some) default settings*/
  223. #define LK_AR_ENABLE    0xe3        /* global auto repeat enable    */
  224. #define LK_CL_ENABLE    0x1b        /* keyclick enable        */
  225. #define LK_KBD_ENABLE    0x8b        /* keyboard enable        */
  226. #define LK_BELL_ENABLE    0x23        /* the bell            */
  227. #define LK_LED_ENABLE    0x13        /* light led            */
  228. #define LK_LED_DISABLE    0x11        /* turn off led            */
  229. #define LK_RING_BELL    0xa7        /* ring keyboard bell        */
  230. #define LED_1        0x81        /* led bits            */
  231. #define LED_2        0x82
  232. #define LED_3        0x84
  233. #define LED_4        0x88
  234. #define LED_ALL        0x8f
  235. #define LK_KDOWN_ERROR    0x3d        /* key down on powerup error    */
  236. #define LK_POWER_ERROR    0x3e        /* keyboard failure on pwrup tst*/
  237. #define LK_OUTPUT_ERROR 0xb5        /* keystrokes lost during inhbt */
  238. #define LK_INPUT_ERROR    0xb6        /* garbage command to keyboard    */
  239. #define LK_LOWEST    0x56        /* lowest significant keycode    */
  240. #define LK_DIV6_START    0xad        /* start of div 6        */
  241. #define LK_DIV5_END    0xb2        /* end of div 5            */
  242.  
  243. /* Keycodes for special keys and functions */
  244. #define SHIFT    0xae
  245. #define LOCK    0xb0
  246. #define REPEAT    0xb4
  247. #define CNTRL    0xaf
  248. #define ALLUP    0xb3
  249. #define HOLD    0x56
  250.  
  251. /* DZ11/32 register device structure */
  252. struct dzdevice {
  253.     short dzcsr;
  254.     short dzrbuf;
  255.     union {
  256.         struct {
  257.             char    dztcr0;
  258.             char    dzdtr0;
  259.             char    dztbuf0;
  260.             char    dzbrk0;
  261.         } dz11;
  262.         struct {
  263.             short    dzlcs0;
  264.             char    dztbuf0;
  265.             char    dzlnen0;
  266.         } dz32;
  267.     } dzun;
  268. };
  269.  
  270. /* Pseudo DMA structure */
  271. struct cnpdma {
  272.         char *p_mem;
  273.     char *p_end;
  274. };
  275.  
  276. /* Driver and data specific structure */
  277. /***** cn_tty must be first *****/
  278. struct    cn_softc {
  279.     struct    tty cn_tty[NCNLINE];    /* Tty structure        */
  280.     struct    dzdevice sc_dz;        /* DZ11/32 structure        */
  281.     struct    cnpdma cn_pdma[NCNLINE];/* peudo dma structure        */
  282.     volatile struct cn_reg *sc_regs; /* PMAX SLU registers        */
  283.     long    sc_flags[NCNLINE];    /* Flags (one per line)        */
  284.     long    sc_category_flags[NCNLINE]; /* Category flags (one per line)*/
  285.     u_long    sc_softcnt[NCNLINE];    /* Soft error count total    */
  286.     u_long    sc_hardcnt[NCNLINE];    /* Hard error count total    */
  287.     char    sc_device[DEV_SIZE][NCNLINE]; /* Device type string    */
  288. };
  289.  
  290.